package com.ape.redis.init;

import org.springframework.stereotype.Component;

/**
 * Redis 实现自动预热加载缓存
 * 1.定义缓存的抽象类AbstractCache
 * */
@Component
public abstract class AbstractCache {

    public abstract void initCache();

    public abstract <T> T getCache();

    public abstract void clearCache();

    public void reloadCache() {
        clearCache();
        initCache();
    }
}